1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Drawing;
5 using System.Data;
6 using System.Linq;
7 using System.Text;
8 using System.Threading.Tasks;
9 using System.Windows.Forms;
10
11 namespace SoftQuanLyNhaHang.Controllers
12 {
13 class ThucDonCtrl
14 {
15 public static DataSet FillDataSet_getLoaiThucDonByIdThucDon(string _idThucDon)
16 {
17 try
18 {
19 Models.ThucDonMod Tdon = new Models.ThucDonMod(_idThucDon);
20 return Tdon.FillDataSet_getLoaiThucDonByIdThucDon();
21
22 }
23 catch
24 {
25 return null;
26 }
27 }
28 // Method Add
29 public static int InsertThucDon(string _idThucdon,string _tenLoaithucdon,string _tenThucdon,string _donVitinh,float _soLuongton,float _donGiaton,float _tonToithieu,string _trangThai)
30 {
31 try
32 {
33 Models.ThucDonMod _Thucdon = new Models.ThucDonMod(_idThucdon,_tenLoaithucdon,_tenThucdon,_donVitinh,_soLuongton,_donGiaton,_tonToithieu,_trangThai);
34 return _Thucdon.InsertThucDon();
35 }
36 catch
37 {
38 return 0;
39 }
40 }
41 // Method Update
42 public static int UpdateThucDon(string _idThucdon, string _tenLoaithucdon, string _tenThucdon, string _donVitinh, float _soLuongton, float _donGiaton, float _tonToithieu, string _trangThai)
43 {
44 try
45 {
46 Models.ThucDonMod _Thucdon = new Models.ThucDonMod(_idThucdon, _tenLoaithucdon, _tenThucdon, _donVitinh, _soLuongton, _donGiaton, _tonToithieu, _trangThai);
47 return _Thucdon.UpdateThucDon();
48 }
49 catch
50 {
51 return 0;
52 }
53
54 }
55 // Method Delete
56 public static int DeleteThucDon(string _idThucDon)
57 {
58 try
59 {
60 Models.ThucDonMod _Thucdon = new Models.ThucDonMod(_idThucDon);
61 return _Thucdon.DeleteThucDon();
62 }
63 catch
64 {
65 return 0;
66 }
67
68 }
69 }
70 }